package spring.study.startup.aop;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AspectjConfig {

    @Before("execution(* spring.study.startup.aop.AopService.*(..))")
    public void doBefore(JoinPoint joinPoint){
        System.out.println("aop before");
    }

    @AfterReturning(returning = "ret", pointcut = "execution(* spring.study.startup.aop.AopService.*(..))")
    public void doAfterReturning(Object ret){
        System.out.println("aop after ");
        System.out.println("-----------------");
    }

}
